package com.xjh.basestudy.algorithmandexercise.sort;


public class SimpleHeap {
    /**
     * 非逃逸对象的栈上分配：大对象不适合栈上分配 *
     * * VM Args: -server -Xmx10M -Xms10M -XX:+DoEscapeAnalysis -XX:+PrintGC -XX:-UseTLAB -XX:+EliminateAllocations *
     * * @author xuefeihu *
     */

    public static class User {
        public int id = 0;
        public String name = "";
    }

    public static void alloc() {
        User u = new User();
        u.id = 5;
        u.name = "geym";

    }


    public static void main(String[] args) {
        long b = System.currentTimeMillis();
        for (int i = 0; i < 100000000; i++) {
            alloc();
        }
        long e = System.currentTimeMillis();
        System.out.println(e - b);
    }

}


